<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动定位</title>
    <style>
        body > div {
            width: 200px;
            border: 4px solid red;
            /*解决元素所有子元素全部浮动时，高度自动识别为0，后面的元素会顶上来导致显示异常的问题*/
            overflow: hidden;
        }

        #d1 {
            width: 50px;
            height: 50px;
            background-color: red;
            float: left;
        }
        #d2{
            width: 50px;
            height: 50px;
            background-color: green;
            float: left;
        }
        #d3{
            width: 50px;
            height: 50px;
            background-color: blue;
            float: left;
        }
        ul{
            list-style-type: none;
            overflow: hidden;
        }
        li{
            float: left;
            margin-right: 20px;
            text-decoration: none;
        }
        a{
            text-decoration: none;
        }
    </style>
</head>
<body>
<div>
    <div id="d1"></div>
    <div id="d2"></div>
    <div id="d3"></div>
</div>
<ul>
    <li><a href="">首页</a></li>
    <li><a href="">免费课</a></li>
    <li><a href="">直播课</a></li>
    <li><a href="">精品课</a></li>
    <li><a href="">线上班</a></li>
    <li><a href="">线下班</a></li>
</ul>
</body>
</html>